package cn.yuanqiao.web.controller.archive.appManager;/**
 * @author 赵常飞
 * @date 2024/6/4 13:53
 */


import cn.yuanqiao.archive.appManager.domain.TenantRyMjDzb;
import cn.yuanqiao.archive.appManager.service.ITenantMijiComparisonTableService;
import cn.yuanqiao.common.annotation.Log;
import cn.yuanqiao.common.core.controller.BaseController;
import cn.yuanqiao.common.core.domain.AjaxResult;
import cn.yuanqiao.common.core.domain.R;
import cn.yuanqiao.common.enums.BusinessType;
import cn.yuanqiao.manage.service.IMijiComparisonTableService;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 *@Author: 赵常飞
 *@Date: 2024/6/4 13:53
 *@Description:
 *@Note:
 */
@RestController
@RequestMapping("/archive/mjdzb")
public class TenantMijiComparisonTableController extends BaseController {
    @Autowired
    private ITenantMijiComparisonTableService iTenantMijiComparisonTableService;

    @Log(title = "获取人员密级字典", businessType = BusinessType.SELECT)
    @GetMapping("/getrymjdict")
    public AjaxResult getcatemodeltree(){
        return success(iTenantMijiComparisonTableService.getrymjdict());
    }

    @Log(title = "获取档案密级字典", businessType = BusinessType.SELECT)
    @GetMapping("/getdamjdict")
    public AjaxResult getdamjdict(){
        return success(iTenantMijiComparisonTableService.getdamjdict());
    }

    @Log(title = "保存人员密级对照表", businessType = BusinessType.INSERT)
    @PostMapping("/save")
    public AjaxResult save(@RequestBody JSONObject json){
        return success(iTenantMijiComparisonTableService.save(json));
    }
    @Log(title = "根据人员密级获取能查看的档案密级", businessType = BusinessType.SELECT)
    @PostMapping("/getdamjbyrymj")
    public AjaxResult getdamjbyrymj(){
        return success(iTenantMijiComparisonTableService.getdamjbyrymj());
    }

    @Log(title = "根据人员密级获取能查看的档案密级API", businessType = BusinessType.SELECT)
    @PostMapping("/getdamjbyrymjList")
    public List<TenantRyMjDzb> getdamjbyrymjList(){
        return iTenantMijiComparisonTableService.getdamjbyrymj();
    }

    @Log(title = "根据档案密级和文件密级进行判断", businessType = BusinessType.SELECT)
    @PostMapping("/determine")
    public AjaxResult determine(@RequestBody JSONObject json){
        return success(iTenantMijiComparisonTableService.determine(json));
    }
    @Log(title = "根据人员密级获取能查看的档案密级", businessType = BusinessType.SELECT)
    @PostMapping("/getdamjbyrymjforsys")
    public R<AjaxResult> getdamjbyrymjforsys(){
        return R.ok(success(iTenantMijiComparisonTableService.getdamjbyrymjforsys()));
    }
    @Log(title = "获取密级对照表回显", businessType = BusinessType.SELECT)
    @GetMapping("/getmjdzb")
    public AjaxResult getmjdzb(){
        return success(iTenantMijiComparisonTableService.getmjdzb());
    }
}
